-- GENERATED SPELL FOR [Ethereal Crypt Raider] --


function spell0_18311(pUnit, Event) --@Battle Shout,Self--
pUnit:FullCastSpellOnTarget(31403,pUnit)
pUnit:RegisterEvent('Sorts_18311', 539, 1)
end

function spell1_18311(pUnit, Event) --@Charge,n/a--
pUnit:FullCastSpellOnTarget(22911,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18311', 2300, 1)
end

function spell2_18311(pUnit, Event) --@Enrage,Self--
pUnit:FullCastSpellOnTarget(8599,pUnit)
pUnit:RegisterEvent('Sorts_18311', 537, 1)
end

function spell3_18311(pUnit, Event) --@Soul Strike,n/a--
pUnit:FullCastSpellOnTarget(32315,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18311', 5277, 1)
end

function Sorts_18311(pUnit, Event)
local choix_sorts_18311 = math.random(0, 3)
if choix_sorts_18311 == 0 then
pUnit:RegisterEvent('spell0_18311', 1, 1)
end
if choix_sorts_18311 == 1 then
pUnit:RegisterEvent('spell1_18311', 1, 1)
end
if choix_sorts_18311 == 2 then
pUnit:RegisterEvent('spell2_18311', 1, 1)
end
if choix_sorts_18311 == 3 then
pUnit:RegisterEvent('spell3_18311', 1, 1)
end
end

function mob18311_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18311', math.random(1500, 3000), 1)
end

function mob18311_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18311_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18311_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18311, 1, 'mob18311_Action')
RegisterUnitEvent(18311, 2, 'mob18311_Leave')
RegisterUnitEvent(18311, 3, 'mob18311_Kill')
RegisterUnitEvent(18311, 4, 'mob18311_Die')
